CPLEX=cplex121
CONCERT=concert29
CPARCH=x86-64_debian4.0_4.1
O_FILES = CommandEngine.o  XgmmlCreator.o cluster.o structs.o

CFLAGS+= -ansi -pedantic-errors -Wall -g
CFLAGS+= -I/usr/local/stow/${CPLEX}/lib/${CPLEX}/include
CFLAGS+= -I/usr/local/stow/${CONCERT}/lib/${CONCERT}/include/
CFLAGS+= -I/usr/include/libxml2

LDFLAGS+= -L/usr/local/stow/${CPLEX}/lib/${CPLEX}/lib/${CPARCH}/static_pic -lilocplex -lcplex 
LDFLAGS+= -lm -lpthread -lgraph
LDFLAGS+= -lxml2

all: kcluster

clean:
	rm kcluster $(O_FILES)

kcluster: $(O_FILES) cluster.o
	gcc -o kcluster $(O_FILES) $(CFLAGS) $(LDFLAGS)
	
CommandEngine.o: CommandEngine.c CommandEngine.h XgmmlCreator.h cluster.h
	gcc -c $(CFLAGS) $*.c

XgmmlCreator.o: XgmmlCreator.h XgmmlCreator.c structs.c structs.h
	gcc -c $(CFLAGS) $*.c

structs.o: structs.c structs.h
	gcc -c $(CFLAGS) $*.c
	
cluster.o: cluster.h cluster.c
	gcc -c $(CFLAGS) cluster.c